Skip to content

feat(watcher): add filesystem_watchers.ignore_dirs #1705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

alex-courtis
Copy link
Member

#1606

Add filesystem_watchers.ignore_dirs.

Tested:

  • exact path
  • trailing directory
  • project directory
  • escaped specials like \\.

@alex-courtis
Copy link
Member Author

alex-courtis commented Oct 31, 2022

@yehuohan

I would be very grateful if you could test:

cd /path/to/nvim-tree.lua
git pull
git checkout 1606-watchers-ignore-dir
  • disable git integration
  • no ignore (bad behaviour)
  • ignore_dirs = { "CMakeFiles" } (good behaviour)

@alex-courtis alex-courtis mentioned this pull request Oct 31, 2022
2 tasks
@alex-courtis alex-courtis merged commit ed9db63 into master Nov 4, 2022
@yehuohan
Copy link

yehuohan commented Nov 5, 2022

@alex-courtis Sorry for late test until this weekend.

With ignore_dirs parameter, there is no large memory consumption anymore to build with cmake.

Attach the complete test configuration for nvim here:

let $DotVimDir=resolve(expand('<sfile>:p:h'))
set rtp^=$DotVimDir
call plug#begin($DotVimDir.'/bundle')
    Plug 'kyazdani42/nvim-tree.lua'
call plug#end()

lua << EOF
    local tcb = require('nvim-tree.config').nvim_tree_callback
    require('nvim-tree').setup{
        auto_reload_on_write = false,
        log = {
          enable = true,
          truncate = true,
          types = {
            all = false,
            config = false,
            copy_paste = false,
            dev = false,
            diagnostics = false,
            git = true,
            profile = true,
            watcher = true,
          },
        },
        filesystem_watchers = {
            enable = true,
            ignore_dirs = { "CMakeFiles" },
        },
        diagnostics = { enable = false },
        git = { enable = false },
    }
EOF

By the way, does this PR has the feature tear down watcher on failure, notifying the user once?
It seemed the watcher wasn't torn down and nvim got into non-response at the final from large memory consumption when testing without the ignore_dirs parameter.

@alex-courtis
Copy link
Member Author

Many thanks for all your testing @yehuohan

By the way, does this PR has the feature tear down watcher on failure, notifying the user once?
It seemed the watcher wasn't torn down and nvim got into non-response at the final from large memory consumption when testing without the ignore_dirs parameter.

There was a bug with the message on teardown: #1726 which prevented the actual teardown.

Perhaps that was the cause of the unnecessary memory usage. I would be very grateful if you pull latest and try again.

@yehuohan
Copy link

yehuohan commented Nov 6, 2022

@alex-courtis

I tested with the latest nvim-tree.lua without ignore_dirs. There is no large memory consumption and the permission message is displayed. Great!

worked

@alex-courtis
Copy link
Member Author

I tested with the latest nvim-tree.lua without ignore_dirs. There is no large memory consumption and the permission message is displayed. Great!

Fantastic! Many thanks.

@alex-courtis alex-courtis deleted the 1606-watchers-ignore-dir branch December 16, 2022 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants